/* Class75_Sub1 - Decompiled by JODE
 * Visit http://jode.sourceforge.net/
 */
import java.awt.Component;

import javax.sound.sampled.AudioFormat;
import javax.sound.sampled.AudioSystem;
import javax.sound.sampled.DataLine;
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.Mixer;
import javax.sound.sampled.SourceDataLine;

public class Class75_Sub1 extends Class75
{
    public byte[] aByteArray3325;
    public AudioFormat anAudioFormat3326;
    public int anInt3327;
    public boolean aBoolean3328 = false;
    public SourceDataLine aSourceDataLine3329;
    public static Class aClass3330;
    
    public void method1353() {
	int i = 256;
	if (Class14_Sub2_Sub2.aBoolean3763)
	    i <<= 1;
	for (int i_0_ = 0; i_0_ < i; i_0_++) {
	    int i_1_ = anIntArray1150[i_0_];
	    if ((i_1_ + 8388608 & ~0xffffff) != 0)
		i_1_ = 0x7fffff ^ i_1_ >> 31;
	    aByteArray3325[i_0_ * 2] = (byte) (i_1_ >> 8);
	    aByteArray3325[i_0_ * 2 + 1] = (byte) (i_1_ >> 16);
	}
	aSourceDataLine3329.write(aByteArray3325, 0, i << 1);
    }
    
    public void method1347(int arg0) throws LineUnavailableException {
	try {
	    DataLine.Info info
		= (new DataLine.Info
		   ((aClass3330 == null
		     ? (aClass3330
			= method1354("javax.sound.sampled.SourceDataLine"))
		     : aClass3330),
		    anAudioFormat3326,
		    arg0 << (!Class14_Sub2_Sub2.aBoolean3763 ? 1 : 2)));
	    aSourceDataLine3329 = (SourceDataLine) AudioSystem.getLine(info);
	    aSourceDataLine3329.open();
	    aSourceDataLine3329.start();
	    anInt3327 = arg0;
	} catch (LineUnavailableException lineunavailableexception) {
	    if (-2 != (Class52.method1202(252645135, arg0) ^ 0xffffffff))
		method1347(Class14_Sub8_Sub33.method653(arg0, 79));
	    else {
		aSourceDataLine3329 = null;
		throw lineunavailableexception;
	    }
	}
    }
    
    public int method1342() {
	int i;
	try {
	    i = anInt3327 - (aSourceDataLine3329.available()
			     >> (Class14_Sub2_Sub2.aBoolean3763 ? 2 : 1));
	} catch (RuntimeException runtimeexception) {
	    throw runtimeexception;
	}
	return i;
    }
    
    public void method1351() {
	if (null != aSourceDataLine3329) {
	    aSourceDataLine3329.close();
	    aSourceDataLine3329 = null;
	}
    }
    
    public void method1350(Component arg0) {
	Mixer.Info[] infos = AudioSystem.getMixerInfo();
	if (null != infos) {
	    int i = 0;
	    for (Mixer.Info[] infos_2_ = infos;
		 (i ^ 0xffffffff) > (infos_2_.length ^ 0xffffffff); i++) {
		Mixer.Info info = infos_2_[i];
		if (null != info) {
		    String string = info.getName();
		    if (null != string
			&& (string.toLowerCase().indexOf("soundmax")
			    ^ 0xffffffff) <= -1)
			aBoolean3328 = true;
		}
	    }
	}
	anAudioFormat3326
	    = new AudioFormat((float) Class115.anInt1909, 16,
			      Class14_Sub2_Sub2.aBoolean3763 ? 2 : 1, true,
			      false);
	aByteArray3325
	    = new byte[256 << (Class14_Sub2_Sub2.aBoolean3763 ? 2 : 1)];
    }
    
    public void method1335() throws LineUnavailableException {
	aSourceDataLine3329.flush();
	if (aBoolean3328) {
	    aSourceDataLine3329.close();
	    aSourceDataLine3329 = null;
	    DataLine.Info info
		= (new DataLine.Info
		   ((aClass3330 == null
		     ? (aClass3330
			= method1354("javax.sound.sampled.SourceDataLine"))
		     : aClass3330),
		    anAudioFormat3326,
		    anInt3327 << (Class14_Sub2_Sub2.aBoolean3763 ? 2 : 1)));
	    aSourceDataLine3329 = (SourceDataLine) AudioSystem.getLine(info);
	    aSourceDataLine3329.open();
	    aSourceDataLine3329.start();
	}
    }
    
    public static Class method1354(String arg0) {
	Class var_class;
	try {
	    var_class = Class.forName(arg0);
	} catch (ClassNotFoundException classnotfoundexception) {
	    return null;
	}
	return var_class;
    }
}
